//
//  HealthAndDietViewController.m
//  muscleLife
//
//  Created by xalo on 16/4/29.
//  Copyright © 2016年 HeavenAndHell. All rights reserved.
//

#import "HealthAndDietViewController.h"
#define kDietUrl @"http://apicloud.mob.com/v1/cook/category/query"
#import "DietViewController.h"
#import <MobAPI/MobAPI.h>
#import "HealthViewController.h"
@interface HealthAndDietViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *healthImage;
@property (weak, nonatomic) IBOutlet UIImageView *dietImage;
@property (weak, nonatomic) IBOutlet UILabel *healthLabel;
@property (weak, nonatomic) IBOutlet UILabel *dietLabel;


@end

@implementation HealthAndDietViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    [self setTapGesture];
}

//给ImageView添加手势
-(void)setTapGesture{
    UITapGestureRecognizer *tapHealthImage=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageAction:)];
    UITapGestureRecognizer *tapDietImage=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageAction:)];
    self.healthImage.userInteractionEnabled=YES;
    self.dietImage.userInteractionEnabled=YES;
    [self.healthImage addGestureRecognizer:tapHealthImage];
    [self.dietImage addGestureRecognizer:tapDietImage];
}

//手势事件
-(void)tapImageAction:(UITapGestureRecognizer *)sender{
    if ([sender view] == self.healthImage) {
        HealthViewController *healthVC=[[UIStoryboard storyboardWithName:@"Heath" bundle:nil]instantiateViewControllerWithIdentifier:@"HealthViewController"];
        [self.navigationController pushViewController:healthVC animated:YES];
        
    }else{
        DietViewController *dietVC=[[DietViewController alloc]init];
        [self.navigationController pushViewController:dietVC animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


@end
